package catpcha

import (
	"github.com/mojocn/base64Captcha"
	"github.com/redis/go-redis/v9"
)

func NewCaptcha(client *redis.Client) *base64Captcha.Captcha {
	var driver base64Captcha.Driver
	store := RedisStore{
		client,
	}

	driverDigit := &base64Captcha.DriverDigit{
		Height:   80,  //高度
		Width:    240, //宽度
		MaxSkew:  0.7,
		Length:   6, //数字个数
		DotCount: 80,
	}
	driver = driverDigit
	//生成验证码
	return base64Captcha.NewCaptcha(driver, store)
}
